package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ZsLeaveMapper;
import com.ruoyi.system.domain.ZsLeave;
import com.ruoyi.system.service.IZsLeaveService;

/**
 * 请假单Service业务层处理
 * 
 * @author jetlion
 * @date 2022-08-30
 */
@Service
public class ZsLeaveServiceImpl implements IZsLeaveService 
{
    @Autowired
    private ZsLeaveMapper zsLeaveMapper;

    /**
     * 查询请假单
     * 
     * @param id 请假单主键
     * @return 请假单
     */
    @Override
    public ZsLeave selectZsLeaveById(Long id)
    {
        return zsLeaveMapper.selectZsLeaveById(id);
    }

    /**
     * 查询请假单列表
     * 
     * @param zsLeave 请假单
     * @return 请假单
     */
    @Override
    public List<ZsLeave> selectZsLeaveList(ZsLeave zsLeave)
    {
        return zsLeaveMapper.selectZsLeaveList(zsLeave);
    }

    /**
     * 新增请假单
     * 
     * @param zsLeave 请假单
     * @return 结果
     */
    @Override
    public int insertZsLeave(ZsLeave zsLeave)
    {
        zsLeave.setCreateTime(DateUtils.getNowDate());
        return zsLeaveMapper.insertZsLeave(zsLeave);
    }

    /**
     * 修改请假单
     * 
     * @param zsLeave 请假单
     * @return 结果
     */
    @Override
    public int updateZsLeave(ZsLeave zsLeave)
    {
        zsLeave.setUpdateTime(DateUtils.getNowDate());
        return zsLeaveMapper.updateZsLeave(zsLeave);
    }

    /**
     * 批量删除请假单
     * 
     * @param ids 需要删除的请假单主键
     * @return 结果
     */
    @Override
    public int deleteZsLeaveByIds(Long[] ids)
    {
        return zsLeaveMapper.deleteZsLeaveByIds(ids);
    }

    /**
     * 删除请假单信息
     * 
     * @param id 请假单主键
     * @return 结果
     */
    @Override
    public int deleteZsLeaveById(Long id)
    {
        return zsLeaveMapper.deleteZsLeaveById(id);
    }
}
